package com.yan.json;

import com.alibaba.fastjson.JSON;
import com.yan.jackson.Student;

import java.util.List;

/**
 * @author taoge
 * @Date 2024/8/13 15:03
 * @Description
 */
public class JsonDemo3 {
    public static void main(String[] args) {
        String stu = "{\"age\":18,\"birthday\":1723532152831,\"name\":\"yft\"}";
        Student student = JSON.parseObject(stu, Student.class);
        System.out.println(student);
        String listStu = "[{\"age\":18,\"birthday\":0,\"name\":\"hpy\"},{\"age\":19,\"birthday\":110,\"name\":\"cqp\"},{\"age\":20,\"birthday\":11110,\"name\":\"wl\"}]";
        List<Student> list = JSON.parseArray(listStu, Student.class);
        System.out.println(list);
    }
}
